package com.fr.report;

import com.fr.base.FRContext;
import com.fr.base.Inter;
import com.fr.base.core.BaseCoreUtils;
import com.fr.base.core.ComparatorUtils;
import com.fr.util.Utils;
import java.io.Serializable;
import java.util.Locale;

public class PaperSize
  implements Cloneable, Serializable
{
  public static final PaperSize PAPERSIZE_9X11 = new PaperSize(9.0D, 11.0D);
  public static final PaperSize PAPERSIZE_10X11 = new PaperSize(10.0D, 11.0D);
  public static final PaperSize PAPERSIZE_10X14 = new PaperSize(10.0D, 14.0D);
  public static final PaperSize PAPERSIZE_11X17 = new PaperSize(11.0D, 17.0D);
  public static final PaperSize PAPERSIZE_15x11 = new PaperSize(15.0D, 11.0D);
  public static final PaperSize PAPERSIZE_LETTER = new PaperSize(8.5D, 11.0D);
  public static final PaperSize PAPERSIZE_NOTE = new PaperSize(7.5D, 10.0D);
  public static final PaperSize PAPERSIZE_LEGAL = new PaperSize(8.5D, 14.0D);
  public static final PaperSize PAPERSIZE_A0 = new PaperSize(33.055999999999997D, 46.777999999999999D);
  public static final PaperSize PAPERSIZE_A1 = new PaperSize(23.388999999999999D, 33.055999999999997D);
  public static final PaperSize PAPERSIZE_A2 = new PaperSize(16.527999999999999D, 23.388999999999999D);
  public static final PaperSize PAPERSIZE_A3 = new PaperSize(11.693D, 16.536000000000001D);
  public static final PaperSize PAPERSIZE_A3_XL = new PaperSize(12.67717D, 17.519690000000001D);
  public static final PaperSize PAPERSIZE_A4 = new PaperSize(8.268000000000001D, 11.693D);
  public static final PaperSize PAPERSIZE_A4_XL = new PaperSize(9.267720000000001D, 12.688980000000001D);
  public static final PaperSize PAPERSIZE_A4_ML = new PaperSize(8.268000000000001D, 12.99213D);
  public static final PaperSize PAPERSIZE_A5 = new PaperSize(5.827D, 8.268000000000001D);
  public static final PaperSize PAPERSIZE_A5_XL = new PaperSize(6.8504D, 9.25197D);
  public static final PaperSize PAPERSIZE_A6 = new PaperSize(4.125D, 5.847D);
  public static final PaperSize PAPERSIZE_A7 = new PaperSize(2.917D, 4.125D);
  public static final PaperSize PAPERSIZE_A8 = new PaperSize(2.056D, 2.917D);
  public static final PaperSize PAPERSIZE_B0 = new PaperSize(39.389000000000003D, 55.667000000000002D);
  public static final PaperSize PAPERSIZE_B1 = new PaperSize(27.832999999999998D, 39.389000000000003D);
  public static final PaperSize PAPERSIZE_B2 = new PaperSize(19.693999999999999D, 27.832999999999998D);
  public static final PaperSize PAPERSIZE_B3 = new PaperSize(13.917D, 19.693999999999999D);
  public static final PaperSize PAPERSIZE_B4 = new PaperSize(9.842976D, 13.937654D);
  public static final PaperSize PAPERSIZE_B4_JIS = new PaperSize(10.118119999999999D, 14.3308D);
  public static final PaperSize PAPERSIZE_B5_JIS = new PaperSize(7.165687D, 10.118579D);
  public static final PaperSize PAPERSIZE_B6_JIS = new PaperSize(5.0394D, 7.165355D);
  public static final PaperSize PAPERSIZE_A3_ROTATE = PAPERSIZE_A3.rotate();
  public static final PaperSize PAPERSIZE_A4_ROTATE = PAPERSIZE_A4.rotate();
  public static final PaperSize PAPERSIZE_A5_ROTATE = PAPERSIZE_A5.rotate();
  public static final PaperSize PAPERSIZE_A6_ROTATE = PAPERSIZE_A6.rotate();
  public static final PaperSize PAPERSIZE_B4_JIS_ROTATE = PAPERSIZE_B4_JIS.rotate();
  public static final PaperSize PAPERSIZE_B5_JIS_ROTATE = PAPERSIZE_B5_JIS.rotate();
  public static final PaperSize PAPERSIZE_B6_JIS_ROTATE = PAPERSIZE_B6_JIS.rotate();
  public static final PaperSize PAPERSIZE_TABLOID = new PaperSize(11.0D, 17.0D);
  public static final PaperSize PAPERSIZE_LEDGER = new PaperSize(17.0D, 11.0D);
  public static final PaperSize PAPERSIZE_HALFLETTER = new PaperSize(5.5D, 8.5D);
  public static final PaperSize PAPERSIZE_EXECUTIVE = new PaperSize(7.2481D, 10.5D);
  public static final PaperSize PAPERSIZE_FOLIO = new PaperSize(8.5D, 13.0D);
  public static final PaperSize PAPERSIZE_QUARTO = new PaperSize(8.464600000000001D, 10.826779999999999D);
  public static final int PREDEFINED = 0;
  public static final int USERDEFINED = 1;
  private double width;
  private double height;

  public PaperSize()
  {
    this(PAPERSIZE_A4.getWidth(), PAPERSIZE_A4.getHeight());
  }

  public PaperSize(double paramDouble1, double paramDouble2)
  {
    setWidth(paramDouble1);
    setHeight(paramDouble2);
  }

  public double getWidth()
  {
    return this.width;
  }

  public void setWidth(double paramDouble)
  {
    this.width = paramDouble;
  }

  public double getHeight()
  {
    return this.height;
  }

  public void setHeight(double paramDouble)
  {
    this.height = paramDouble;
  }

  public PaperSize rotate()
  {
    return new PaperSize(getHeight(), getWidth());
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof PaperSize))
      return false;
    PaperSize localPaperSize = (PaperSize)paramObject;
    return ((getWidth() == localPaperSize.getWidth()) && (getHeight() == localPaperSize.getHeight()));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public String toString()
  {
    Locale localLocale = FRContext.getLocale();
    if (ComparatorUtils.equals(Locale.CHINA, localLocale))
      return Utils.doubleToString(BaseCoreUtils.convertInchesToMillimeters(getWidth())) + "x" + Utils.doubleToString(BaseCoreUtils.convertInchesToMillimeters(getHeight())) + Inter.getLocText("PageSetup-mm");
    return getWidth() + "x" + getHeight() + Inter.getLocText("PageSetup-inches");
  }
}